<!DOCTYPE html>
<html class="ui-page-login">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link href="css/mui.min.css" rel="stylesheet" />
		<link href="css/style.css" rel="stylesheet" />
		<style> 
		     .mui-bar-tab{
				 background: #FFFFFF;
				 box-shadow: none;
			 }
			 .mui-tab-item>img{
				 width: 21px!important;
				 height: 18px!important;
			 }
			 .mui-active{
				 color: #FE635F!important;
			 }
			 .shangchaun{
				 width: 46px!important;
				 height: 46px!important;
				 position: absolute!important;
				 top: -18px!important;
				 left: calc(50% - 23px);
				 background: #FFFFFF;
				 border-radius: 50%;
			 }
			 .shangchaun  img{
				 width: 39px;
				 height: 39px;
				 margin-top: 4px;
			 }
			 .shangd{
				 margin-top: 24px;
			 }
			  * { touch-action: pan-y; }
		</style>

	</head>

	<body>

		
		
	
	      
	<nav class="mui-bar mui-bar-tab  ">
		<a class="mui-tab-item mui-active" index="0" href="sub1.html">
			<img  class="mui-icon"  src="image/shoua12.png" />
			<span class="mui-tab-label">首页</span>
		</a>
		<a class="mui-tab-item" index="1"  href="sub2.html">
			<img class="mui-icon"  src="image/shou13.png" />
			<span class="mui-tab-label">商城</span>
		</a>
		<a class="mui-tab-item" index="2" href="sub3.html">
		   <span  class="mui-icon shangchaun"><img  src="image/sshangchuan.png" /></span>
			<span class="mui-tab-label  shangd">上传发布</span>
		</a>
		<a class="mui-tab-item" index="3" href="sub4.html">
			<img  class="mui-icon" src="image/shou14.png" />
			<span class="mui-tab-label">社区</span>
		</a>
		<a class="mui-tab-item" index="4"  href="sub5.html">
		<img  class="mui-icon" src="image/shou15.png" />
			<span class="mui-tab-label">我的</span>
		</a>
	</nav>
	
	</body>
	<script src="js/jquery-3.1.1.min.js"></script>
	<script src="js/mui.min.js"></script>
		<!-- <script src="js/jquery.3.3.1.min.js"></script> -->
		<script  type="text/javascript">
			window.addEventListener("refresherd", function (e) {
								var pageId = "sub4.html";
								 var pageId2 = 'sub5.html';
								 var page3 = 'sub3.html';
								 var page = plus.webview.getWebviewById(pageId);//刷新页面
								 var page1 = plus.webview.getWebviewById(pageId2);
								 var page2 = plus.webview.getWebviewById(page3);
								page.reload();
								page1.reload();
								page2.reload();
							});
						
		 mui.init({})
		 var  subpage=["sub1.html","sub2.html","sub3.html","sub4.html","sub5.html"]	;
		 var srcdd=["image/shou12.png","image/shou13.png","image/sshangchuan.png","image/shou14.png","image/shou15.png"]
		 var srcd=["image/shoua12.png","image/shoua13.png","image/sshangchuan.png","image/shoua14.png","image/shoua15.png"]
		 var style={
			 top:"0px",
			 bottom:"80px"
		 }
		 mui.plusReady(function () {
		     var webview=plus.webview.currentWebview();
			 for(var  i=0;i<subpage.length;i++){
				 var  sub=plus.webview.create(subpage[i],subpage[i],style)
				 sub.hide()
				 webview.append(sub)
			 }
			 plus.webview.show(subpage[0]);
			 
			 
			mui(".mui-bar-tab").on("tap","a",function(){
				var that = $(this);
			
				var  index=this.getAttribute("index");
				var suoyou  = $(this).siblings();
				var newindex = 0;
				$.each(suoyou,function(i,v){
					newindex = $(v).attr('index');
					$(v).children('img').attr('src',srcdd[newindex]);
				})
				that.children('img').attr('src',srcd[index]);
				var  href=this.getAttribute("href");
				plus.webview.show(href);
			})
			var user = plus.storage.getItem('user');
			if(user==''||user==undefined){
				// var ws=plus.webview.currentWebview();
				// 	plus.webview.close(ws);
				mui.openWindow({
					url:"login.html",
					id:"login.html",
					show: {
						autoShow: true, //页面loaded事件发生后自动显示，默认为true
						aniShow: "slide-in-right", //页面显示动画，默认为”slide-in-right“；
						duration: 100 //页面动画持续时间，Android平台默认100毫秒，iOS平台默认200毫秒；
					},
					waiting: {
						autoShow: true, //自动显示等待框，默认为true
						title: '正在加载...', //等待对话框上显示的提示内容
					}
				})
				// var ws=plus.webview.currentWebview();
				// 	plus.webview.close(ws);
			}
			
		 })

		</script>
</html>